package myjava.inheritance._protected_otherPackage;

import myjava.inheritance._private_.*;

public class Root {

   public static void main(String[] args) {

      Dad d = new Dad();
      Son sonOutOfPackage = new Son();

      // # DIFFERENT PACKAGE SCENARIO #
      // e' in questa prospettiva crosspackage che protected mostra le sue caratteristiche

      // stuff you CANNOT do:
      // System.out.println(d.foo);
      // UNA VOLTA EREDITATO foo SI COMPORTA COME PRIVATE
      // System.out.println(sonOutOfPackage.foo);

      // stuff you can do
      System.out.println(sonOutOfPackage.getFoo());
   }
}